<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=360, initial-scale=0.75 user-scalable=no">
        {% block header_ext %}
        {% endblock %}
        <title>
            {% block title %}LittleScheduler - {% if title %}{{ title }}{% endif %}{% endblock %}
        </title>
        <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
    </head>

    <body>
        <nav class="navbar navbar-default">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="{{ url_for('home.index') }}">LittleScheduler</a>
                </div>

                <div class="navbar-collapse collapse">
                    {% if current_user.is_authenticated %}
                    <div class="navbar-form navbar-right">
                        {{ current_user.name }}
                        <a class="btn btn-info" id="new-btn" href="{{ url_for('home.logout') }}">退出</a>
                    </div>
                    {% else %}
                    <div class="navbar-form navbar-right">
                        <ul class="nav navbar-nav">
                        <li class="dropdown">
                          <button type="button" class="btn btn-info btn-primary dropdown-toggle" data-toggle="dropdown">
                            登录  <b class="caret"></b>
                          </button>
                            <ul class="dropdown-menu">
                            <li><a href="{{ url_for('home.login') }}">登录</a></li>
                            </ul>
                        </li>
                        </ul>
                    </div>
                    {% endif %}
                </div>
            </div>
        </nav>

        <div id="wrap">
            <div class="container" id="main">
                <ul class=flashes>
                {% for message in get_flashed_messages() %}
                  <li>{{ message }}</li>
                {% endfor %}
                </ul>
                <div class="row">
                    {% block inside_row %}
                    {% endblock %}
                </div>
            </div>
        </div>

        <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
        <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
        {% block footer_ext %}{% endblock %}
    </body>
</html>
